<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="app">
			<h1>这是第二页的内容</h1>
			<router-link to="/home">首页</router-link>
			<router-link to="/welcome">欢迎</router-link>
			<router-view></router-view>
		</div>
		<template id="homTem">
			<div>
				<h1>这是首页</h1>
			</div>
		</template>
		<template id="welcomeTem">
			<div>
				<h1>这是欢迎界面</h1>
			</div>
		</template>
		<script src="../js/vue.js"></script>
		<script src="../js/vue-router.js"></script>
		<script>
			
			let homCom ={
				template:"#homTem"
			}
			let welcomeCom={
				template:"#welcomeTem"
			}
			let router = new VueRouter({
				routes:[{path:"/home",component:homCom},
						{path:"/welcome",component:welcomeCom}
						]
			})
			
			const app = new Vue({
				el:"#app",
				router
			})
		</script>
	</body>
</html>
